package com.hmy.pig.service.impl;

import com.hmy.pig.domain.HmyPigBreed;
import com.hmy.pig.mapper.PigBreedMapper;
import com.hmy.pig.mapper.PigMapper;
import com.hmy.pig.service.PigBreedService;
import com.hmy.staff.domain.HmyStaff;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zhl
 * @descript 描述 猪只配种 业务层 实现类
 * @date 2024-01-29
 */

@Service
public class PigBreedServiceImpl implements PigBreedService {
    @Resource
    private PigBreedMapper pigBreedMapper;

    @Override
    public List<HmyPigBreed> selectPigBreedList(String pigCode, Integer pigBreedType, String pigBreedManager, String pigBreedTimeStart, String pigBreedTimeEnd) {
        return pigBreedMapper.selectPigBreedList(
                pigCode,
                pigBreedType,
                pigBreedManager,
                pigBreedTimeStart,
                pigBreedTimeEnd);
    }
    /*
     * @param hmyPigBreed
     * @return int
     * @author ZHL
     * @date 2024/1/29 19:08
     * @description   新增猪只配种记录
     */
    @Override
    public int insertPigBreed(HmyPigBreed hmyPigBreed) {

        //新增猪只配种信息
        int rows = pigBreedMapper.insertPigBreed(hmyPigBreed);
        return rows;
    }

    /**
     *  通过猪只耳号查询猪只配种记录
     *
     * @author ZHL
     * @date 2024/1/30 9:57
     *
     */
    @Override
    public HmyPigBreed selectPigBreedByPigBreedId(Long pigBreedId) {
        return pigBreedMapper.selectPigBreedByPigBreedId(pigBreedId);
    }
    /**
     * @param hmyPigBreed
     * @return int
     * @author ZHL
     * @date 2024/1/30 10:07
     * @description 修改猪只档案信息
     */
    @Override
    public int updatePigBreed(HmyPigBreed hmyPigBreed) {
        return pigBreedMapper.updatePigBreed(hmyPigBreed);
    }
    /**
     * @param pigBreedId
     * @return int
     * @author ZHL
     * @date 2024/1/30 10:26
     * @description   通过PigId 删除 猪只档案信息
     */
    @Override
    public int deletePigBreedByPigBreedId(Long pigBreedId) {
        return pigBreedMapper.deletePigBreedByPigBreedId(pigBreedId);
    }
    /**
     * @param pigBreedIds
     * @return int
     * @author ZHL
     * @date 2024/1/30 13:38
     * @description    批量删除猪只档案信息
     */
    @Override
    public int deletePigBreedByPigBreedIds(Long[] pigBreedIds) {
        return pigBreedMapper.deletePigBreedByPigBreedIds(pigBreedIds);
    }
    /**
     * @return java.util.List<com.hmy.staff.domain.HmyStaff>
     * @author ZHL
     * @date 2024/2/21 11:18
     * @description  查询员工类型中所有的配种管理员
     */
    @Override
    public List<HmyStaff> findAllStaffName() {
        return pigBreedMapper.findAllStaffName();
    }


}
